package com.pos43.business.service.impl;

import java.util.List;

import com.pos43.business.dao.IOrdersDao;
import com.pos43.business.dao.IUserDao;
import com.pos43.business.dao.impl.OrdersDao;
import com.pos43.business.dao.impl.UserDao;
import com.pos43.business.service.IOrdersService;
import com.pos43.domain.Orders;

public class OrdersService implements IOrdersService{
	
	IOrdersDao orderDao = new OrdersDao();
	IUserDao userDao = new UserDao();
	
	public IUserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}

	public IOrdersDao getOrderDao() {
		return orderDao;
	}

	public void setOrderDao(IOrdersDao orderDao) {
		this.orderDao = orderDao;
	}

//	public Integer addOrders(Float summ, Boolean isVip, User user)
	public Integer addOrders(Orders order){
//		Orders orderInstance = new Orders();
//		orderInstance.setAddDate(new Date());
//		orderInstance.setSumm(summ);
//		orderInstance.setIsVip(isVip);
//		orderInstance.setUser(user);
		return orderDao.save(order);
	}
	
	 public void delOrders(Integer orderId){
		 orderDao.delete(orderId);
	 }
	 
	 public void updateOrders(Orders order){
		 orderDao.update(order);
	 }
	 
	 public List<Orders> listOrders(){
		 return orderDao.findAll();
	 }
	 
	 public Orders getOrders(Integer orderId){
		 return orderDao.get(orderId);
	 }

	public IOrdersDao getOrdersDao() {
		return orderDao;
	}

	public void setOrdersDao(IOrdersDao orderDao) {
		this.orderDao = orderDao;
	}

	

}
